package com.company.cloud.club.modules.core.util;

import java.time.ZoneId;
import java.time.format.DateTimeFormatter;
import java.util.HashMap;
import java.util.Map;

/**
 * @author precision
 */
public final class Constants {

    public static final Map<Byte, String> WEEKDAYS = new HashMap<>(7);
    public static final String VERTICAL_LINE = "|";
    public static final String VERTICAL_LINE_REGEX = "\\|";
    public static final Integer DEFAULT_REPORT_BEFORE = 3;
    public static final Integer DEFAULT_RELATION_NUM = 0;

    public static final ZoneId DEFAULT_ZONE_ID = ZoneId.systemDefault();

    static {
        WEEKDAYS.put((byte)0, "周日");
        WEEKDAYS.put((byte)1, "周一");
        WEEKDAYS.put((byte)2, "周二");
        WEEKDAYS.put((byte)3, "周三");
        WEEKDAYS.put((byte)4, "周四");
        WEEKDAYS.put((byte)5, "周五");
        WEEKDAYS.put((byte)6, "周六");
    }

    public static final byte[] EMPTY_BYTE_ARRAY = new byte[0];

    public static final String KEYS_PATTERN = "keys:%s";

    /**
     * 基于redis进行唯一ID生成的Key
     */
    public static final String EXAM_PACKAGE_KEY = "package-key";

    public static final String EXAM_ITEM_KEY = "item-key";

    public static final String EXAM_EXTRA_PACKAGE_KEY = "extra-package-key";

    public static final String EXAM_EXPERT_KEY = "expert-key";

    public static final String EXAM_COMPANY_KEY = "company-key";

    public static final String EXAM_TIME_SCHEDULE_KEY = "time-schedule-key";

    // 企业编号
    public static final String TD_COMPANY_CODE_PATTERN = "TD-%s-%s";

    // 专家编号
    public static final String TD_EXPERT_CODE_PATTERN = "ZJ-%s-%s";

    // DX+类别01-99+项目序号001-999
    public static final String ITEM_CODE_PATTERN = "DX-%s-%s";

    //TC-TD-id-2-1
    public static final String TD_PACKAGE_CODE_PATTERN = "TC-TD-%s-%s-%s";

    //JXB-TD-2019-机构编号-001-1-0
    public static final String JXB_PACKAGE_CODE_PATTERN = "JXB-TD-%s-%s-%s";

    public static final String TD_RESERVATION_EXPORT_FILE_NAME_PATTERN = "td_reservation_%s_%s";

    public static final String TD_JG_EXPORT_FILE_NAME_PATTERN = "TD_JG_%s";

    public static final String TD_DX_EXPORT_FILE_NAME_PATTERN = "TD_DX_%s";

    public static final String TD_TC_EXPORT_FILE_NAME_PATTERN = "TD_TC_%s";

    public static final String TD_JXB_EXPORT_FILE_NAME_PATTERN = "TD_JXB_%s";

    public static final String TD_EXPERT_EXPORT_FILE_NAME_PATTERN = "TD_EXPERT_%s";

    public static final String TD_ALL_EXPORT_FILE_NAME_PATTERN = "TD_ALL_%s";

    public static final String TD_DATA_EXPORT_FILE_NAME_PATTERN = "TD_DATA_%s";

    public static final String ORDER_EXPORT_FILE_NAME_PATTERN = "ORDER_%s";

    public static final String RESERVATION_EXPORT_FILE_NAME_PATTERN = "reservation_%s_%s";

    public static final String REPORT_DELIVER_EXPORT_FILE_NAME_PATTERN = "get_report_%s";

    public static final String REPORT_EXPLAIN_EXPORT_FILE_NAME_PATTERN = "read_report_%s";

    /** 默认日期时间格式 */
    public static final String DEFAULT_DATE_TIME_FORMAT = "yyyy-MM-dd HH:mm:ss";
    /** 默认日期格式 */
    public static final String DEFAULT_DATE_FORMAT = "yyyy-MM-dd";
    /** 默认时间格式 */
    public static final String DEFAULT_TIME_FORMAT = "HH:mm:ss";

    public static final DateTimeFormatter defaultDateFormatter = DateTimeFormatter.ofPattern(DEFAULT_DATE_FORMAT);

    public static final DateTimeFormatter defaultDateTimeFormatter = DateTimeFormatter.ofPattern(DEFAULT_DATE_TIME_FORMAT);

    // 已取消
    public static final Byte RESERVATION_CANCELED_RESULT = (byte)0;

    // 未预约
    public static final Byte RESERVATION_NOT_RESULT = (byte)1;

    // 预约未支付
    public static final Byte RESERVATION_NOT_PAID_RESULT = (byte)2;

    // 支付中
    public static final Byte RESERVATION_PAYING_RESULT = (byte)3;

    // 已预约
    public static final Byte RESERVATION_PAID_RESULT = (byte)4;

    // 预约失败
    public static final Byte RESERVATION_FAILED_RESULT = (byte)5;

    // 体检完成
    public static final Byte RESERVATION_EXAMED_RESULT = (byte)6;

    // 已出报告
    public static final Byte RESERVATION_REPORTED_RESULT = (byte)7;

    // 未知状态
    public static final Byte RESERVATION_UNKNOWN_RESULT = (byte)100;

}
